<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li ><a href="{:url('TemplateGroup/index')}">套件管理</a></li>
        <li class="active"><a href="">列表</a></li>
        <li><a href="javascript:add({$Request.param.id})">新建套件</a></li>
    </ul>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('TemplateGroup/sort')}">
        <!-- <div class="table-actions">
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('TemplateGroup/sets',array('status'=>1))}" data-subcheck="true">启用
            </button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('TemplateGroup/sets',array('status'=>2))}" data-subcheck="true">停用
            </button>
        </div> -->
        
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
                <th width="50">套件ID</th>
                <th>表头名称</th>
                <th>课题名称</th>
				<th>表尾名称</th>
                <th>套件状态</th>
                <th>模板类别</th>
                <th>创建日期</th>
                <th width="200">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="data" item="vo">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                               value="{$vo.header_id}"></td>
                    
                    <td>{$vo.group_id}</td>
					<td>{$vo.header.name} &nbsp;ID:{$vo.header_id}</td>
                    <td>{$vo.template.name}&nbsp;ID:{$vo.template_id}</td>
                    <td>{$vo.footer.name}&nbsp;ID:{$vo.footer_id}</td>
                    <if condition="$vo.status == 1">
                        <td>显示</td>
                    <else/>
                        <td>隐藏</td>
                    </if>
                    <td>{$vo.category.name}</td>
                    <td>{$vo.create_time}</td>
                    <td>
                        <if condition="$vo.status == 2">
                             <a href="{:url('set',array('group_id'=>$vo['group_id'],'status'=>1))}" class="js-ajax-dialog-btn" data-msg="确定要显示么">显示</a>|
                        <else/>
                            <a href="{:url('set',array('group_id'=>$vo['group_id'],'status'=>2))}" class="js-ajax-dialog-btn" data-msg="确定要隐藏么">隐藏</a>|
                        </if>
						<a href="javascript:toEdit({$vo.group_id})">编辑</a>|
						<a href="javascript:look({$vo.group_id})">预览</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
            <tfoot>
            <tr>

                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
                <th width="50">套件ID</th>
                <th>表头名称</th>
                <th>课题名称</th>
                <th>表尾名称</th>
                <th>套件状态</th>
                <th>模板类别</th>
                <th>创建日期</th>
                <th width="200">{:lang('ACTIONS')}</th>
            </tr>
            </tfoot>
        </table>
        <!-- <div class="table-actions">
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('TemplateGroup/sets',array('status'=>1))}" data-subcheck="true">启用
            </button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('TemplateGroup/sets',array('status'=>2))}" data-subcheck="true">停用
            </button>
        </div> -->
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
     function add(id){
        //打开新增窗口
        openIframeLayer("/admin/Template_group/add/id/"+id, '添加套件', {
            area: ['600px', '600px'],
        });
    }
    function toEdit(id){
        openIframeLayer("/admin/Template_group/edit/id/"+id, '编辑', {
            area: ['600px', '600px'],
        });
    }
    function look(id){
        openIframeLayer("/admin/Template_group/look/group_id/"+id, '预览', {
            area: ['40%', '90%'],
        });
    }
</script>
</body>
</html>